﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
    <head>
        <meta content="Innovasys Document! X (http://www.innovasys.com)" name=GENERATOR>
        <!--DXMETADATA start type="MetaCharset" --><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><!--DXMETADATA end-->
        <!--DXMETADATA start type="PageItemTitle" format="<title>CreateFromXML Method</title>" --><title>CreateFromXML Method</title><!--DXMETADATA end-->
        <link href="stylesheets/axstylesheet.css" type=text/css rel=stylesheet>
        <script src="script/ax.js" type=text/javascript>
    </script>

    


<style>
html,div { margin: 0; padding: 0;}

body {
	padding: 0px;
	margin: 0px;
	overflow: auto;
	height: 100%;
}

#winchm_template_button{
	float: right;
	width: 93px;
	top: 7px;
	position: relative;
	text-align: right;
	right: 5px;
	height: auto;
}

#winchm_template_top{
	padding: 0px;
	margin: 0px;
	border-bottom: 1px solid #9B9B9B;
	background-color: #B1CEFE;
}

#winchm_template_navigation{
	margin: 0px;
	padding-top: 7px;
	padding-left: 7px;
	padding-bottom: 3px;
	padding-right: 0px;
	font-size: 8.5pt;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	color: #585858;
}

#winchm_template_title{
	margin: 0px;
	padding-top: 4px;
	padding-left: 7px;
	padding-bottom: 7px;
	padding-right: 0px;
	font-size: 18px; 
	font-family: Verdana, Geneva, sans-serif;
	color: #363636;
}

#winchm_template_content{
	margin-top: 20px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	width: auto  !important;
	width: 100%;
}

#winchm_template_footer{
	border-width: 1px;
	border-color: #B1CEFE;
	border-top-style: solid;
	margin-top: 15px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	padding-top: 7px;
	padding-left: 0px;
	padding-bottom: 0px;
	padding-right: 0px;
	font-family: arial, helvetica, sans-serif;
	font-size: 8.5pt;
	color: #696969;
	width: auto;
	text-align: left;
}


#winchm_template_container{
	margin: 0px;
	padding: 0px;
	position: static;
	padding-bottom: 3px;
	overflow: auto;
	background-color: #FFFFFF;
}


@media print
{
#winchm_template_container{
	position: static;	
	margin: 0px;
	padding: 5px;
	
	width: auto;
	height: auto;
	overflow: auto;
}
#winchm_template_button{
visibility:hidden;
}
}

#winchm_template_navigation A:link	{text-decoration: none; color:#004080}
#winchm_template_navigation A:visited  {text-decoration: none; color: #004080}
#winchm_template_navigation A:active {text-decoration: none; color: #004080 }
#winchm_template_navigation A:hover {text-decoration: none;color: #0080FF}

A:link	{text-decoration: underline; color:#0033CC}
A:visited  {text-decoration: underline; color: #0033CC}
A:active {text-decoration: underline; color: #0033CC }
A:hover {text-decoration: underline;color: #FF0000;}
</style>
<script type="text/javascript">
function isMobile(){
Agent = window.navigator.userAgent;
if (Agent.indexOf("iPhone")>=1 || Agent.indexOf("iPad")>=1 || Agent.indexOf("iPod")>=1 || Agent.indexOf("Android")>=1){
return true;
}else{
return false;	
}

}
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_container').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_container').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_container').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_container').style.width = 'auto';
document.getElementById('winchm_template_container').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

if(!isMobile()){

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;

document.write("<style>\n");
document.write("body {overflow: hidden;}\n");
document.write("#winchm_template_container {position: absolute;overflow: auto;top : 0px;right: 0px;bottom: 0px;left: 0px;}\n");
document.write("</style>\n");
}

</script>
</head>
    <body><script language="JavaScript" type="text/JavaScript">
function syn(){
if(parent.nav.tree){
 if(parent.nav.tree.loaded){
  parent.nav.tree.selectNode(17739);
 }else{
  setTimeout("syn()",500);
}
  }else{
  setTimeout("syn()",500);
  }}
if(parent!=self){
  setTimeout("syn()",100);
}else{
  parent.location.href = "../index.htm?page=XtremeSuiteControls~TaskDialog~CreateFromXML.html";
}
originalOnload = window.onload;
if(originalOnload==null){
window.onload = function(){parent.contentLoaded = true;};
}else{
window.onload = function(){originalOnload();parent.contentLoaded = true;};
}
</script> 


<div id="winchm_template_top">
	<div id="winchm_template_button"><A href="XtremeSuiteControls~PropExchange~CreateAsXML.html" title="Previous topic"><img id="winchm_template_prev" alt="Previous topic" src="template2/btn_prev_n.gif" border="0"></a><A href="XtremeSuiteControls~ImageManagerIcon~CreatePicture.html" title="Next topic"><img id="winchm_template_next" alt="Next topic" src="template2/btn_next_n.gif" border="0"></a></div>
	<div id="winchm_template_navigation">Help &gt; 
<A href="welcome_screen.htm">Codejock ActiveX Controls v15.3</A> &gt; <A href="XtremeSuiteControls_P.html">Xtreme Suite Controls</A> &gt; Methods &gt; </div>
	<div id="winchm_template_title">CreateFromXML Method</div>
</div>
<div id="winchm_template_container">
	<div id="winchm_template_content"><div class=popupbubble id=dxseealsomenu><p id=dxseealsocontent><a href="#Bookmark17396">TaskDialog Control</a>
&nbsp;|&nbsp;<a href="#Bookmark17411">ShowDialog Method</a>
</p><!--DXMETADATA end --> 
        </div>
        <!--DXMETADATA start type="FilteredItemList" scrap="PARAMETERS_BUBBLES" namespace="parameter" source="Item" -->
<div id="XMLString_box" class="popupbubble">
<DL><DT class="popupbubble"><I>XMLString</I></DT>
<DD class="popupbubble">The contents of a XML file.&nbsp; This string must contain the entire contents of the XML file.</DD></DL>
</div>
<div id="Section_box" class="popupbubble">
<DL><DT class="popupbubble"><I>Section</I></DT>
<DD class="popupbubble">Name of the XML resource to load.&nbsp; This should be the section that contains the dialog you want to load.</DD></DL>
</div>
<div id="Parameters_box" class="popupbubble">
<DL><DT class="popupbubble"><I>Parameters</I></DT>
<DD class="popupbubble"><P>Values to use in the text descriptions of the dialog.&nbsp; More than one paramater can be passed in and can be stored in a string array.&nbsp; These values will be inserted into any text portion of the dialog that contains a  followd by an number.&nbsp; The number corresponds to a parameter in the array and starts with 1.</P>
<P>&nbsp;</P>
<P>For example, 3 paramaters are used in the content section of this dialog1</STRONG>\nType:&nbsp; <STRONG>2</STRONG>\nFrom3</STRONG>&lt;/Content&gt;</P>
<P>&nbsp;</P>
<P>The code to setup the parameters would look like this:</P>
<P>&nbsp;&nbsp;&nbsp; Dim Params(3) As String<BR>&nbsp;&nbsp;&nbsp; Params(0) = "SampleFileName.txt"<BR>&nbsp;&nbsp;&nbsp; Params(1) = "Text Document"<BR>&nbsp;&nbsp;&nbsp; Params(2) = "<A href="http://www.Codejock.com">www.Codejock.com</A>"</P>
<P>&nbsp;&nbsp;&nbsp; taskDialog.CreateFromXML LoadDialogs, "Dialogs/Dialog[@Name='Dialog007']", Params</P>
<P>&nbsp;</P>
<P>Or you can do it like this:</P>
<P><BR>&nbsp;&nbsp;&nbsp; taskDialog.CreateFromXML LoadDialogs, "Dialogs/Dialog[@Name='Dialog007']", Array("SampleFileName.txt", "Text Document", "<A href="http://www.Codejock.com">www.Codejock.com</A>")</P></DD></DL>
</div>
<!--DXMETADATA end --> 
        <div id=pagetop>
            <div id=projectnamebanner>
                <table class=projectnametable cellspacing=0>
                    <tbody>
                        <tr>
                            <!--DXMETADATA start type="Literal" condition="childitems:itemtype=seealso" value="<td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td>" --><td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td><!--DXMETADATA end -->
                            <td>
                                <!--DXMETADATA start type="Phrase" Name="Product_Header" -->Xtreme Suite Controls ActiveX Control v15.3<!--DXMETADATA end --> 
                            </td>
                            <td align=right>
                                <!--DXMETADATA start type="Variable" name="FeedbackLink" format="" --><!--DXMETADATA end -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id=pagetitlebanner>
                <h1 class=dxh1>
                <!--DXMETADATA start type="PageItemTitle" -->CreateFromXML Method<!--DXMETADATA end --></h1>
            </div>
        </div>
        <div id=pagebody valign="bottom">
            <!--DXMETADATA start type="IsNew" format="<script>document.all.pagebody.className = 'newTopic'</script>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Description" source="Item" format="<h4 class=dxh4>$$Description$$</h4><p>%%description%%</p>" --><h4 class=dxh4>Description</h4><p>Creates a&nbsp;dialog from a&nbsp;XML resource file.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Syntax" lang="VB" format="<div Class=LanguageSpecific Name=Syntax_VB><h4 class=dxh4>$$Syntax$$</h4><p>%%Syntax%%</p></div>" --><div Class=LanguageSpecific Name=Syntax_VB><h4 class=dxh4>Syntax</h4><p><PRE CLASS="syntax" LANG="VB"><strong>Public Function CreateFromXML</strong>( _
&nbsp;&nbsp;&nbsp;<strong>ByVal </strong><i><a class="parameter" id="XMLString" href="#" onclick="javascript:showParamBox();">XMLString</a></i></strong> <strong>As</strong> <b>String</b>, _
&nbsp;&nbsp;&nbsp;<strong>ByVal </strong><i><a class="parameter" id="Section" href="#" onclick="javascript:showParamBox();">Section</a></i></strong> <strong>As</strong> <b>String</b>, _
&nbsp;&nbsp;&nbsp;<strong>Optional ByVal </strong><i><a class="parameter" id="Parameters" href="#" onclick="javascript:showParamBox();">Parameters</a></i></strong> <strong>As</strong> <b>Variant</b> _
)<strong> As <b>Boolean</b></strong></PRE></p></div><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="PARAMETERS_LIST" namespace="parameter" source="Item" filter="" format="<h4 class=dxh4>$$ParameterList$$</h4>%%filtereditemlist%%" --><h4 class=dxh4>Parameters</h4><DL>
<DT><I>XMLString</I></DT>
<DD>The contents of a XML file.&nbsp; This string must contain the entire contents of the XML file.</DD>
<DT><I>Section</I></DT>
<DD>Name of the XML resource to load.&nbsp; This should be the section that contains the dialog you want to load.</DD>
<DT><I>Parameters</I></DT>
<DD><P>Values to use in the text descriptions of the dialog.&nbsp; More than one paramater can be passed in and can be stored in a string array.&nbsp; These values will be inserted into any text portion of the dialog that contains a  followd by an number.&nbsp; The number corresponds to a parameter in the array and starts with 1.</P>
<P>&nbsp;</P>
<P>For example, 3 paramaters are used in the content section of this dialog1</STRONG>\nType:&nbsp; <STRONG>2</STRONG>\nFrom3</STRONG>&lt;/Content&gt;</P>
<P>&nbsp;</P>
<P>The code to setup the parameters would look like this:</P>
<P>&nbsp;&nbsp;&nbsp; Dim Params(3) As String<BR>&nbsp;&nbsp;&nbsp; Params(0) = "SampleFileName.txt"<BR>&nbsp;&nbsp;&nbsp; Params(1) = "Text Document"<BR>&nbsp;&nbsp;&nbsp; Params(2) = "<A href="http://www.Codejock.com">www.Codejock.com</A>"</P>
<P>&nbsp;&nbsp;&nbsp; taskDialog.CreateFromXML LoadDialogs, "Dialogs/Dialog[@Name='Dialog007']", Params</P>
<P>&nbsp;</P>
<P>Or you can do it like this:</P>
<P><BR>&nbsp;&nbsp;&nbsp; taskDialog.CreateFromXML LoadDialogs, "Dialogs/Dialog[@Name='Dialog007']", Array("SampleFileName.txt", "Text Document", "<A href="http://www.Codejock.com">www.Codejock.com</A>")</P></DD>
</DL><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##RETURNS" format="<h4 class=dxh4>$$Return_Type$$</h4><p>%%comment%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##REMARKS" format="<h4 class=dxh4>$$Remarks$$</h4><p>%%comment%%</p>" --><h4 class=dxh4>Remarks</h4><p><P>You can use a utility such as <STRONG>TDPad</STRONG>&nbsp;(<A href="http://shellrevealed.com/files/folders/code/tags/TDPad/default.aspx">http://shellrevealed.com/files/folders/code/tags/TDPad/default.aspx</A>) to design and create task dialogs that are stored in a XML file that can be loaded at any time.&nbsp; For example, the dialog below was created using <STRONG>TDPad</STRONG>:</P>
<P><IMG src="Pictures/xmlload.png" border=0></P></p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="sourcecode" format="<h4 class=dxh4>$$Source_Code$$</h4><table border=0 cellpadding=0 cellspacing=0 class=sourcecode><tr><td nowrap>%%sourcecode%%</td></tr></table>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##EXAMPLEINTRO" format="<h4 class=dxh4>$$Example$$</h4><p>%%comment%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="INLINE_EXAMPLE" namespace="Example" source="Item" filter="type=inline" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$Example$$</h4>,format= %%%%filtereditemlist%%" --><h4 class=dxh4>Example</h4><DIV Class=LanguageSpecific Name=Example_><p><SPAN class="lang">[Example XML Dialog ()]</SPAN>&nbsp;Below is the XML to create a dialog that will except 3 parameters.</p><DIV Class=LanguageSpecific Name=Code_><TABLE Class="CodeContainerTable" CellPadding="0" CellSpacing="0" Border="0"><TR><TD NOWRAP><CODE Class="">&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;encoding=&quot;UTF-8&quot;?&gt;&nbsp;<BR/>&lt;Dialogs&nbsp;xmlns=&quot;http://www.codejock.com/schema/TDSchema.xsd&quot;&gt;&nbsp;<BR/>&nbsp;&lt;Dialog&nbsp;Name=&quot;Dialog007&quot;&nbsp;AllowCancel=&quot;true&quot;&nbsp;EnableHyperlinks=&quot;true&quot;&nbsp;MessageBoxStyle=&quot;true&quot;&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;WindowTitle&gt;File&nbsp;Download&lt;/WindowTitle&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;MainInstruction&nbsp;Image=&quot;*Warning&quot;&gt;Do&nbsp;you&nbsp;want&nbsp;To&nbsp;Open&nbsp;%3&nbsp;Or&nbsp;save&nbsp;this&nbsp;file?&lt;/MainInstruction&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;Content&gt;Name:&nbsp;&nbsp;%1\nType:&nbsp;&nbsp;%2\nFrom:&nbsp;&nbsp;%3&lt;/Content&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;Buttons&nbsp;Default=&quot;2&quot;&gt;&nbsp;<BR/>&nbsp;&nbsp;&nbsp;&lt;Cancel/&gt;&nbsp;<BR/>&nbsp;&nbsp;&nbsp;&lt;Button&nbsp;ID=&quot;100&quot;&gt;&amp;Open&lt;/Button&gt;&nbsp;<BR/>&nbsp;&nbsp;&nbsp;&lt;Button&nbsp;ID=&quot;101&quot;&gt;&amp;Save&lt;/Button&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;/Buttons&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;Verification&nbsp;Checked=&quot;true&quot;&gt;&amp;Always&nbsp;ask&nbsp;before&nbsp;Open&lt;/Verification&gt;&nbsp;<BR/>&nbsp;&nbsp;&lt;Footer&nbsp;Image=&quot;*Shield&quot;&gt;While&nbsp;files&nbsp;from&nbsp;Internet&nbsp;can&nbsp;be&nbsp;useful,&nbsp;some&nbsp;files&nbsp;can&nbsp;potentially&nbsp;harm&nbsp;your&nbsp;computer.&nbsp;If&nbsp;you&nbsp;Do&nbsp;Not&nbsp;trust&nbsp;the&nbsp;source,&nbsp;Do&nbsp;Not&nbsp;Open&nbsp;Or&nbsp;save&nbsp;this&nbsp;file.&nbsp;&lt;a&nbsp;href=&quot;http://www.microsoft.com&quot;&gt;What's&nbsp;the&nbsp;risk?&lt;/a&gt;&lt;/Footer&gt;&nbsp;<BR/>&nbsp;&lt;/Dialog&gt;&nbsp;<BR/>&lt;/Dialogs&gt;&nbsp;<BR/>&nbsp;<BR/>&nbsp;<BR/>&nbsp;<BR/></CODE></TD></TR></TABLE></DIV></DIV>
<DIV Class=LanguageSpecific Name=Example_VB><p><SPAN class="lang">[Load From XML File (Visual Basic)]</SPAN>&nbsp;This code will load and display the task dialog in the XML code above.</p><DIV Class=LanguageSpecific Name=Code_VB><TABLE Class="CodeContainerTable" CellPadding="0" CellSpacing="0" Border="0"><TR><TD NOWRAP><CODE Class="VB">taskDialog.Reset<BR/>
taskDialog.CommonButtons = 0<BR/>
<BR/>
<font class='keyword'>Dim</font> Params(3) <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
Params(0) = <font class='string'>&quot;SampleFileName.txt&quot;</font><BR/>
Params(1) = <font class='string'>&quot;Text Document&quot;</font><BR/>
Params(2) = <font class='string'>&quot;www.Codejock.com&quot;</font><BR/>
<BR/>
taskDialog.CreateFromXML LoadDialogs, <font class='string'>&quot;Dialogs/Dialog[@Name='Dialog007']&quot;</font>, Params<BR/>
<font class='comment'>'taskDialog.CreateFromXML LoadDialogs, "Dialogs/Dialog[@Name='Dialog007']", Array("SampleFileName.txt", "Text Document", "www.Codejock.com")</font><BR/>
taskDialog.ShowDialog<BR/>
<BR/>
<font class='keyword'>Function</font> LoadDialogs() <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>On</font> <font class='keyword'>Error</font> <font class='keyword'>Resume</font> <font class='keyword'>Next</font><BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> Dialogs <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Dim</font> FreeF <font class='keyword'>As</font> <font class='keyword'>Integer</font>, sFile <font class='keyword'>As</font> <font class='keyword'>String</font>, sLayout <font class='keyword'>As</font> <font class='keyword'>String</font><BR/>
<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='comment'>'XML string will be loaded from the file.</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;sFile = App.Path & <font class='string'>&quot;\Dialogs.xml&quot;</font><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;FreeF = FreeFile<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;Dialogs = Space(FileLen(sFile))<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Open</font> sFile <font class='keyword'>For</font> Binary <font class='keyword'>As</font> #FreeF<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Get</font> #FreeF, , Dialogs<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>Close</font> #FreeF<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;<font class='keyword'>On</font> <font class='keyword'>Error</font> <font class='keyword'>Goto</font> 0<BR/>
<BR/>
&nbsp;&nbsp;&nbsp;&nbsp;LoadDialogs = Dialogs<BR/>
<BR/>
<font class='keyword'>End</font> <font class='keyword'>Function</font></CODE></TD></TR></TABLE></DIV></DIV>
<!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="seealso" source="Item" filter="" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$See_Also$$</h4><p id=dxseealsocontent>%%filtereditemlist%%</p>" --><h4 class=dxh4>See Also</h4><p id=dxseealsocontent><a href="#Bookmark17396">TaskDialog Control</a>
&nbsp;|&nbsp;<a href="#Bookmark17411">ShowDialog Method</a>
</p><!--DXMETADATA end --><!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="example" source="Item" filter="type=linked" NoHeader="True" NoFooter="True" format="><!--DXMETADATA end --><!--DXMETADATA start type="Variable" name="CopyrightNotice" format="><!--DXMETADATA end --></div></div>	
	<div id="winchm_template_footer">Copyright &copy; 2018. All rights 
reserved. (To change the copyright info, just edit it in template.)</div>
</div>

</body>
</html>

